[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
string Declares a Character String (Array of Char) [TP]
type
<tname> = string[<maxlen>];
var
<vname> : string[<maxlen>];
Standard Pascal does not have a predefined string data type, but Turbo
Pascal does. The underlying type is equivalent to:
array[0..<maxlen>] of Char;
Location [0] holds the current length of the string, while the string
itself is stored in locations [1..<maxlen>]. An entire set of
procedures and functions for string manipulation is available.
<tname> name of data type being defined.
<vname> name of variable being declared.
<maxlen> Integer constant; sets maximum possible length of
the string. Must be in range 1..255.
-------------------------------- Example ---------------------------------
type NameStr = string[20];
BigStr = string[255];
var Name : NameStr; { or Name : string[20]; }
Grade : string[2];
See Also:
array
strings
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson